package org.jivesoftware.smackx.pubsub;

public class GetItemsRequest extends NodeExtension
{
  protected int maxItems;
  protected String subId;

  public GetItemsRequest(String paramString)
  {
    super(PubSubElementType.ITEMS, paramString);
  }

  public GetItemsRequest(String paramString, int paramInt)
  {
    super(PubSubElementType.ITEMS, paramString);
    this.maxItems = paramInt;
  }

  public GetItemsRequest(String paramString1, String paramString2)
  {
    super(PubSubElementType.ITEMS, paramString1);
    this.subId = paramString2;
  }

  public GetItemsRequest(String paramString1, String paramString2, int paramInt)
  {
    this(paramString1, paramInt);
    this.subId = paramString2;
  }

  public int getMaxItems()
  {
    return this.maxItems;
  }

  public String getSubscriptionId()
  {
    return this.subId;
  }

  public String toXML()
  {
    StringBuilder localStringBuilder = new StringBuilder("<");
    localStringBuilder.append(getElementName());
    localStringBuilder.append(" node='");
    localStringBuilder.append(getNode());
    localStringBuilder.append("'");
    if (getSubscriptionId() != null)
    {
      localStringBuilder.append(" subid='");
      localStringBuilder.append(getSubscriptionId());
      localStringBuilder.append("'");
    }
    if (getMaxItems() > 0)
    {
      localStringBuilder.append(" max_items='");
      localStringBuilder.append(getMaxItems());
      localStringBuilder.append("'");
    }
    localStringBuilder.append("/>");
    return localStringBuilder.toString();
  }
}